/*********************************
File: myStack.h
栈元素类型在include之前可以重新定义:
#define STYPE
typedef char TDSTYPE;
#include "myStack.h"
*********************************/

#ifndef MY_STACK
#define MY_STACK

#ifndef STYPE
#define STYPE
typedef int TDSTYPE;
#endif

typedef struct {
    TDSTYPE *stack;
    int top;
} MyStack;

/** Initialize your data structure here. */
MyStack *myStackCreate(int maxSize);


/** Push element x onto stack. */
void myStackPush(MyStack *obj, TDSTYPE x);

/** Removes the element on top of the stack and returns that element. */
TDSTYPE myStackPop(MyStack *obj);

/** Get the top element. */
TDSTYPE myStackTop(MyStack *obj);

/** Returns whether the stack is empty. */
int myStackEmpty(MyStack *obj);

void myStackFree(MyStack *obj);

#endif
